
<template>
  <div class='workerHome_container resize-observer-fix'>
    <el-container class="resize-observer-fix">
      <el-header direction="horizontal">
        <elMenu :el_menu_item="el_menu_item"></elMenu>
      </el-header>
      <el-main class="resize-observer-fix">
        <div class="content-container">
          <router-view v-slot="{ Component }">
            <keep-alive exclude="record_details">
              <component :is="Component" />
            </keep-alive>
          </router-view>
        </div>
      </el-main>
    </el-container>
  </div>
</template>

<script>
import elMenu from '@/public/el-menu/el-menu.vue'

export default {
  //import引入的组件需要注入到对象中才能使?
  components: {
    elMenu
  },
  data () {
    //这里存放数据
    return {
      el_menu_item: [
        { name: '报修中心', index: '/workerHome/worker_repairCenter' },
        { name: '报修记录', index: '/workerHome/worker_repairRecord' },
        { name: '个人中心', index: '/workerCenter' },
      ],
    }
  }
}
</script>

<style lang="scss" scoped>
.workerHome_container {
  width: 100%;
  min-height: 100vh;
  position: relative;
  background: linear-gradient(135deg, #f6f8fb 0%, #e2eafc 100%);
  display: flex;
  flex-direction: column;
}

.resize-observer-fix {
  position: relative;
}

.el-header {
  padding: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.el-main {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  
  .content-container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 15px;
    min-height: auto;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    
    &:hover {
      box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    }
  }
}

/* 媒体查询适配移动设备 */
@media screen and (max-width: 768px) {
  .el-main {
    padding: 10px;
    
    .content-container {
      padding: 10px;
    }
  }
}

:deep(.el-main) {
  padding: 10px;
  overflow-y: auto;
}
</style>
